#include <stdio.h>
#include "game.h"
int main(){
    int s=256;
    int i, j;
    int a[16][16];
    create(a);
    do{
        printf("请第一位选手下棋:\n");
        scanf("%d%d", &i, &j);
        while(a[i][j]!=43){
            printf("落子错误，请重新选择落子位置\n");
            scanf("%d%d", &i, &j);
        }
        a[i][j]=48;
        s--;
        print(a);
        if(selectwin(a,i,j)==48){
            printf("恭喜玩家一获胜!\n");
            break;
        }
        printf("请第二位选手下棋:\n");
        scanf("%d%d", &i, &j);
        while(a[i][j]!=43){
            printf("落子错误，请重新选择落子位置\n");
            scanf("%d%d", &i, &j);
        }        
        a[i][j]=49; 
        s--;
        print(a);
        if(selectwin(a,i,j)==49){
            printf("恭喜玩家二获胜!\n");
            break;
        }
    }while(s>0);
    if(s==0)
        printf("和棋");
    return 0;
}